import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        name: 'index',
        component: () => import('../components/Container.vue'),
        children: [
            {
                path: '/home',
                name: 'home',
                component: () => import('../views/Home.vue')
            },
            {
                path: '/order-record',
                name: 'OrderRecord',
                label: '订单记录',
                component: () => import('../components/Container.vue'),
                children: [
                    {
                        path: '/order-record/list',
                        name: 'ChargingPileList',
                        label: '订单记录列表',
                        component: () =>
                            import('../views/OrderRecord/index.vue')
                    }
                ]
            },
            {
                path: '/charging-pile',
                name: 'ChargingPile',
                label: '充电桩',
                component: () => import('../components/Container.vue'),
                children: [
                    {
                        path: '/charging-pile/details',
                        name: 'ChargingPileDetails',
                        label: '充电桩详情',
                        component: () =>
                            import('../views/ChargingPile/details.vue')
                    }
                ]
            }
        ]
    }
]

const router = new VueRouter({
    // mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router
